package com.ftg.learn.order.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.math.BigDecimal;

@Data
@ToString
@AllArgsConstructor
@NoArgsConstructor
@TableName("order_detail")
@Schema(description = "订单详情实体类")
public class OrderDetail {
    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description = "主键")
    String id;

    @TableField("order_id")
    @Schema(description = "订单id")
    String orderId;

    @TableField("product_id")
    @Schema(description = "商品id")
    Long productId;

    @TableField("name")
    @Schema(description = "商品名称")
    String name;

    @TableField("number")
    @Schema(description = "数量")
    Integer number;

    @TableField("price")
    @Schema(description = "单价")
    BigDecimal price;
}
